package ae.pcfc.etks.online.common;

public abstract class ConstantsCommon {

    public static final String ONLINE_DB_NAME_PREFIX = "TEtks";

	// SC Procedure Names
	//public static final String SINGLE_CLIENT_PERSON_INSERT_PROC = "P_TSC_CLIENT_PERSON_INSERT";
	public static final String SINGLE_CLIENT_PERSON_INSERT_PROC = "P_TSC_PERSON_PROFILE_INSERT";
	//public static final String SINGLE_CLIENT_COMPANY_INSERT_PROC = "P_TSC_CLIENT_COMPANY_INSERT";
	//public static final String SINGLE_CLIENT_COMPANY_INSERT_PROC = "P_TSC_TEMP";
	public static final String SINGLE_CLIENT_COMPANY_INSERT_PROC = "P_TSC_COMPANY_PROFILE_INSERT";
	public static final String GET_SINGLE_CLIENT_PERSON_BY_TRAKHEES_ID = "P_GET_CLNT_PERSON_BY_TKSID";
	public static final String SINGLE_CLIENT_PERSON_ROLE_INSERT = "P_TSC_CLNT_PERSON_ROLE_INSERT";
	public static final String SINGLE_CLIENT_COMPANY_ROLE_INSERT = "P_TSC_CLNT_COMPANY_ROLE_INSERT";
	public static final String SINGLE_CLIENT_VALIDATE_TKSID_PIN = "P_CLNT_VALIDATE_BY_TKSID_PIN";
	public static final String GET_SINGLE_CLIENT_COMPANY_BY_TRAKHEES_ID = "P_GET_CLNT_COMP_BY_TKSID";
	public static final String GET_SINGLE_CLIENT_COMPANY_ROLE_BY_TRAKHEES_ID = "P_GET_CLNT_COMP_ROLE_BY_TKSID";
	public static final String GET_CLIENT_PIN_BY_TRAKHEES_ID = "P_CLNT_PIN_SRCH_BY_TKSID";
	public static final String GET_TAKHEES_ID_AND_PIN_BY_EMAIL = "P_GET_CLNT_TKSID_PIN_BY_EMAIL";
	public static final String GET_CLIENT_TRAKHEES_ID_BY_ROLE_ID = "P_GET_CLNT_TKS_ID_BY_ROLE_ID";
	public static final String SINGLE_CLIENT_VALIDATE_LICENSE = "P_CLNT_VALIDATE_LICENSE";
	public static final String SINGLE_CLIENT_COMPANY_SEARCH = "P_TSC_CLIENT_COMPANY_SEARCH";
	public static final String SINGLE_CLIENT_PERSON_SEARCH = "P_TSC_CLIENT_PERSON_SEARCH";
	public static final String SINGLE_CIENT_VALIDATE_CLIENT_NAME = "P_CLNT_VALIDATE_BY_NAME";
	public static final String SINGLE_CLIENT_COMPANY_ACTIVITY_SEARCH = "P_GET_LICENCE_ACTIVITY";
	
    public static final String SINGLE_CLIENT_PERSON_UPDATE_STATUS_PROC = "P_TSC_PERSON_PROFILE_REMOVE";
    public static final String SINGLE_CLIENT_COMPANY_UPDATE_STATUS_PROC = "P_TSC_COMPANY_PROFILE_REMOVE";
    
	
	//SQL UDTs
	public static final String SINGLE_CLIENT_CLIENT_ROLE_SQL_TYPE = "TYP_CLIENT_ROLE";
	public static final String SINGLE_CLIENT_CLIENT_ROLES_SQL_TYPE = "TYP_CLIENT_ROLES";
	public static final String SINGLE_CLIENT_SYS_ATTRS_SQL_TYPE = "TYP_SYS_ATTRIBUTES";
	public static final String SINGLE_CLIENT_CLIENT_RELATIONSHIPS_SQL_TYPE = "TYP_CLIENT_RELATIONSHIPS";

    //
    public static final String PARTNER_SYSTEM_ID = "ETKSONLINE";
    public static final String PERSON = "P";
    public static final String COMPANY = "C";
    public static final String LICENSE_VALID = "0";
    public static final String COMPANY_ADMIN = "U";
    public static final String COMPANY_EMPLOYEE = "E";
    public static final String INTERNAL_TRAKHEES_STAFF = "I";
    //
    public static final String TRAKHEES_ID = "trakheesId";
    public static final String PIN_CODE = "pinCode";

    public static final String CLIENT_ROLE_STATUS_ACTIVE = "A";
    public static final String CLIENT_ROLE_STATUS_INACTIVE = "D";

    public static final String CLIENT_STATUS_INACTIVE = "I";
    
    //
    public static final String APPROVE = "A";
    public static final String REJECT = "R";

    //
    public static final String WORK_FLOW_STATUS_APPROVE = "APPROVED";
    public static final String WORK_FLOW_STATUS_REJECT = "REJECT";
    public static final String IN_PROGRESS = "I";

    //
    public static final String SERVICE_DEFAULT = "Y";
    public static final String SERVICE_ACTIVE = "Y";
    public static final String SERVICE_INTERNAL = "I";
    public static final String SERVICE_EXTERNAL = "E";

    // Password Reset Default length
    public static final int PASSWORD_RESET_DEFAULT_LENGTH = 8;

    //Moving this to etks-Online-wf
    //public static final String USER_PREFIX = "group.root.ad/";

    public static final String DISABLE = "D";
    public static final String ADMIN = "A";
    public static final String ENABLE = "Y";
    public static final String ACTIVE = "A";

    public static final String COMPANY_EMPLOYEE_DEFAULT_SERVICE = "CED";
    public static final String COMPANY_ADMIN_DEFAULT_SERVICE = "CAD";
    public static final String INTERNAL_STAFF_DEFAULT_SERVICE = "IS";

    public static final String DEFAULT_SERVICE_ROLE_COMPANY_ID = "1";
    public static final String DEFAULT_DEPT_CODE_INTERNAL_SERVICE = "0";
    public static final String SERVICE_ROLE_ID_INTERNAL_SERVICE = "0";

    public static final String SET_VALUE = "1";
    public static final String UNSET_VALUE = "0";
    //public static final String NOT_APPLICABLE = "NA";

    public static final String TRUE = "TRUE";

    public static final String WORKFLOW_STEP_CODE_PREFIX = "REV";

    public static final String PROCESS_STEP_CODE_CONNECTOR = "_";

    public static final String PROCESS_STEP_REVIEW = "REVIEW";

    /**
     * 
     * Description: WFProcessType - Contains the valid process codes for
     * different application requests
     */
    public enum WFProcessType {
	CLIENT_COMPANY_REGISTRATION("CCR"), CLIENT_ROLE_REQUEST("CRR"), NON_CLIENT_PERSON_REGISTRATION(
		"NCPR"), CLIENT_PERSON_REGISTRATION("CPR"), NON_CLIENT_COMPANY_REGISTRATION(
		"NCCR"), SERVICE_REGISTRATION("SR"), CLD_EMPLOYMENT_VISA_OUTSIDE_COUNTRY(
		"EVOC"), CLD_EMPLOYMENT_VISA_INSIDE_COUNTRY("EVIC"), CLD_VISIT_VISA_ONE_MONTH(
		"VVOM"), CLD_VISIT_VISA_THREE_MONTH("VVTM"), CLD_TRANSFER_SPONSORSHIP(
		"TS"), CLD_INTERNAL_TRANSFER("IT"), CLD_CANCELLATION_OF_VISA(
		"COV"), CLD_RENEWAL_OF_VISA("ROV"), CLD_NOCS_AND_LETTERS("NAL"), EHS_OPERATION_FITNESS_CERTIFICATE_NEW(
		"OFCN"), EHS_OPERATION_FITNESS_CERTIFICATE_RENEWAL("OFCR"), EHS_OPERATION_FITNESS_CERTIFICATE_AMENDMENT(
		"OFCA");

	private String processCode;

	private WFProcessType(String processCode) {
	    this.processCode = processCode;
	}

	@Override
	public String toString() {
	    return processCode;
	}

	public String getProcessCode() {
	    return processCode;
	}

	public static WFProcessType getWFProcessTypefromString(
		String processCode) {
	    if (processCode != null) {
		for (WFProcessType type : WFProcessType.values()) {
		    if (processCode.equalsIgnoreCase(type.processCode)) {
			return type;
		    }
		}
	    }
	    return null;
	}

    }

    /**
     * Description: RequestType enum which contains codes to differentiate
     * different types of applications
     * 
     */
    public enum RequestType {
	PERSON("P"), COMPANY("C"), ROLE("R"), SERVICE("S");

	private String code;

	private RequestType(String code) {
	    this.code = code;
	}

	@Override
	public String toString() {
	    return code;
	}

	public String getCode() {
	    return code;
	}

	public static RequestType getRequestTypefromString(String code) {
	    if (code != null) {
		for (RequestType type : RequestType.values()) {
		    if (code.equalsIgnoreCase(type.code)) {
			return type;
		    }
		}
	    }
	    return null;
	}
    }

    /**
     * Description: WorkflowDepartment enum contains the departments codes
     * 
     */
    public enum WorkflowDepartment {
	CLD("CLD"), CED("CED"), EHS("EHS"), FINANCE("FINANCE");

	private String code;

	private WorkflowDepartment(String code) {
	    this.code = code;
	}

	@Override
	public String toString() {
	    return code;
	}

	public String getCode() {
	    return code;
	}

	public static WorkflowDepartment getWorkflowDepartmentfromString(
		String code) {
	    if (code != null) {
		for (WorkflowDepartment type : WorkflowDepartment.values()) {
		    if (code.equalsIgnoreCase(type.code)) {
			return type;
		    }
		}
	    }
	    return null;
	}
    }
}
